class Rs:
    # 代号
    code: int = 0

    # 提示消息
    message: str = ""

    # 数据
    data: any

    def __init__(self, code: int = 0, message: str = "", data=None) -> None:
        """
        初始化
        """
        if data is None:
            data = {}
        self.code = code
        self.message = message
        self.data = data

    def to_dict(self):
        return {"code": self.code, "message": self.message, "data": self.data}

    @staticmethod
    def ok():
        return {"code": 0, "message": "success"}
